<?php

/**
 * @author Dingo
 */
class Form_Logowanie {

    public static function generuj($action) {
        $formularz = '<div class="form">';
        $Config = array(
            // Default fields size
            'size' => 35,
            // Default fields error css
            'css_error' => 'fields_error',
            'template_open' => '<div class="form_row">',
            'template_label' => '<label>|LABEL|</label>',
            'template_field' => '|FIELD|',
            'template_error' => '<BR><font class="error">- |ERROR|</font>',
            'template_close' => '</div>',
            'template_line' => "\n",
            'template_field_one' => '<div class="form_row">|LABEL||FIELD|</div>'
        );


        $Form = & new Form_AuriumForm($Config);
        $formularz .= $Form->OpenForm(array('m' => 'p', 'action' => $action));

        $login = array(
            'label' => 'Login:',
            'type' => 'text',
            'name' => 'login',
            'css' => 'main_input'
        );

        $haslo = array(
            'label' => 'Hasło:',
            'type' => 'password',
            'name' => 'haslo',
            'css' => 'main_input'
        );

        $przyciski = array(
            'type' => 'button',
            'subtype' => array('reset','submit'),
            'value' => array('Resetuj','Zaloguj się'),
            'css' => 'submit',
            'alone' => true
        );

        $Form->SetData(array($login, $haslo));
        $formularz .= $Form->ShowFields();
        $formularz .= $Form->OneField($przyciski);
        $formularz .= $Form->CloseForm();
        $formularz .= '</div>';
        return $formularz;
    }

}

?>
